org.eclipse.vtp.desktop.projects.voice.internals
Class VoiceModel

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.voice.internals.VoiceModel

public class VoiceModel
extends java.lang.Object

A model that represents the voice project XML format.

Author:
Lonnie Pryor

Field Summary
static java.lang.String NS_URI_VOICE
          The namespace URI used for the top-level elemenets.
static java.lang.String PREFIX_VOICE
          The prefix used for the top-level elemenets.
 
Constructor Summary
VoiceModel(org.eclipse.core.resources.IFile descriptor)
          Creates a new VoiceModel.
VoiceModel(IVoiceProject project)
          Creates a new VoiceModel.
 
Method Summary
 void addChangeObserver(java.lang.Runnable observer)
          Adds a change observer to this model.
 IVoiceProject getProject()
          Returns the project this model is contained in.
 Content getSharedContent(java.lang.String name)
          Returns the shared content value under the specified name or null if no such content exists in this model.
 java.lang.String[] getSharedContentNames()
          Returns the names of all the shared content items in this model.
 void load()
          Load the descriptor represented by this model.
 void putSharedContent(java.lang.String name, Content content)
          Sets the shared content item registered under the specified name.
 void removeChangeObserver(java.lang.Runnable observer)
          Removes a change observer from this model.
 void removeSharedContent(java.lang.String name)
          Removes the shared content item under the specified name.
 void save(org.eclipse.core.runtime.IProgressMonitor monitor)
          Saves the descriptor represented by this model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NS_URI_VOICE

public static final java.lang.String NS_URI_VOICE
The namespace URI used for the top-level elemenets.

See Also:
Constant Field Values

PREFIX_VOICE

public static final java.lang.String PREFIX_VOICE
The prefix used for the top-level elemenets.

See Also:
Constant Field Values
Constructor Detail

VoiceModel

public VoiceModel(org.eclipse.core.resources.IFile descriptor)
Creates a new VoiceModel.


VoiceModel

public VoiceModel(IVoiceProject project)
Creates a new VoiceModel.

Method Detail

getProject

public IVoiceProject getProject()
Returns the project this model is contained in.

Returns:
The project this model is contained in.

getSharedContentNames

public java.lang.String[] getSharedContentNames()
Returns the names of all the shared content items in this model.

Returns:
The names of all the shared content items in this model.

getSharedContent

public Content getSharedContent(java.lang.String name)
Returns the shared content value under the specified name or null if no such content exists in this model.

Parameters:
name - The name of the content to return.
Returns:
The shared content value under the specified name or null if no such content exists in this model.

putSharedContent

public void putSharedContent(java.lang.String name,
                             Content content)
Sets the shared content item registered under the specified name.

Parameters:
name - The name to regster the shared content item under.
content - The value of the shared content item or null to remove the specified item.

removeSharedContent

public void removeSharedContent(java.lang.String name)
Removes the shared content item under the specified name.

Parameters:
name - The name of the shared content item to remove.

load

public void load()
          throws java.io.IOException
Load the descriptor represented by this model.

Throws:
java.io.IOException - If the descriptor cannot be loaded.

save

public void save(org.eclipse.core.runtime.IProgressMonitor monitor)
          throws java.io.IOException
Saves the descriptor represented by this model.

Parameters:
monitor - The progress monitor to notify or null if no monitoring is desired.
Throws:
java.io.IOException - If the descriptor cannot be loaded.

addChangeObserver

public void addChangeObserver(java.lang.Runnable observer)
Adds a change observer to this model.

Parameters:
observer - The observer to add.

removeChangeObserver

public void removeChangeObserver(java.lang.Runnable observer)
Removes a change observer from this model.

Parameters:
observer - The observer to remove.